<template>
	<view>
		<swiper class="swiper_box" :indicator-dots="true" :autoplay="true" :circular="true" indicator-color="#BEBDBB"
		 :interval="3000" :duration="1000" indicator-active-color="#ffffff">
			<swiper-item v-for="(item,index) in getlunbo" :key='index'>
				<image :src="item.cover" mode=""></image>
			</swiper-item>
		</swiper>
		<view class="peoduct_top">
			<view class="peoduct_top_title diandiandian">
				原膳越南草虾仁(黑虎虾)200g
			</view>
			<view class="peoduct_top_price">
				<view class="peoduct_top_price_left">
					￥32.90
				</view>
				<view class="peoduct_top_price_right">
					销量1000
				</view>
			</view>
			<view class="product_hengxina">

			</view>
			<view class="product_soack">
				<view class="product_soack_left">
					<image src="/static/prodtct/gantanhao.png" mode=""></image>不支持7天无理由退货
				</view>
				<view class="product_soack_right">
					库存1000
				</view>
			</view>
		</view>
		<view class="product_sku">
			规格<text>2.2kg/袋</text>
		</view>
		<view class="" style="background-color: #EFEFF4;">
			<view class="product_comment">
				<view class="product_comment_top">
					<view class="product_comment_top_left"> 产品评价（108）

					</view>
					<view class="product_comment_top_right" @click="gopingjia">
						查看更多>
					</view>
				</view>
				<view class="product_comment_people">
					<view class="product_comment_people_left">
						<image src="../../static/index/index21.png" mode=""></image>
						<view>鱼书</view>
					</view>
					<view class="product_comment_people_right">
						2020-05-12 17:11
					</view>
				</view>
				<view class="product_comment_center">
					<view class="product_comment_center_top">
						薪聚客是一款小巧、好用的手机兼职APP，提供各种类型的任务用户选择，空闲时间，拿出手机做小任务，就能快速赚取零花钱。
					</view>
					<view class="product_comment_for_list">

						<view class="product_comment_for" v-for="(item,index) in getlunbo" :key="index">
							<image :src="item.cover" mode=""></image>

						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="Product_xiangqing">
			<image src="/static/prodtct/qiangqing.png" mode=""></image>
		</view>
		<view class="product_pic">
			<view v-for="(item,index) in getlunbo" :key="index">
				<image :src="item.cover" mode=""></image>
			</view>
		</view>
		<view class="Product_xiangqing">
			<image src="/static/prodtct/guanxian.png" mode=""></image>
		</view>
		<view class="product_list">
			<view class="product_list_box" v-for="(item,index) in list" :key="index">
				<image :src="item.img" mode=""></image>
				<view class="product_list_box_bottom">

					<view class="product_list_title tuodiandiandian">{{item.title}}

					</view>
					<view class="product_list_price">
						￥<text style="font-size: 30rpx;">{{item.price}}</text>
					</view>
					<view class="product_list_txt diandiandian">
						{{item.text}}
					</view>
					<view class="product_list_bottom">
						<view class="product_list_bottom_left">
							销售量{{item.xiaoliang}}
						</view>
						<view class="product_list_bottom_right">{{item.pingfen}}<text style="font-size: 22rpx;">分</text>

						</view>
					</view>
				</view>
			</view>
		</view>

		<view class="product_fiexd">
			<view class="product_fiexd_lisy">
				<image src="/static/prodtct/dianpu.png" mode=""></image>
				<text>店铺</text>
			</view>
			<view class="product_fiexd_lisy">
				<image src="/static/prodtct/kefu.png" mode=""></image>
				<text>客服</text>
			</view>
			<view class="product_fiexd_lisy" @click="open(1)">
				<image src="/static/prodtct/cart.png" mode=""></image>
				<text>加购物车</text>
			</view>
			<view class="product_fiexd_button" @click="open(2)">
				立即购买
			</view>
		</view>
		<uni-popup ref="popup" type="bottom">
			
			<view class="popup_box">
				<view class="popup_box_top">
					<view class="popup_box_top_left">
						<image src="../../static/dating/public.png" mode=""></image>
					</view>
					<view class="popup_box_top_center">
						<view class="" style="color: red;">
							￥<text>69</text>
						</view>
						<view class="popup_box_top_center_guige">
							已选 灰色；M
						</view>
					</view>
					<view class="popup_box_top_right" @click="close">
						<image src="../../static/prodtct/cha.png" style="width: 30rpx;height: 30rpx;" mode=""></image>
					</view>
				</view>
				<view class="popup_box_guige">
					<view class="popup_box_guige_box" v-for="(item,index) in GUIGE" :key="index">
						<view class="popup_box_guige_box">
							{{item.title}}
						</view>
						<view class="popup_box_guige_box_list">

							<view class="popup_box_guige_for" @click="dianji(item1,index)" :class="{checked:index==n}" v-for="(item1,index) in item.sku" :key="index">

								<image :src="item1.ima" mode="" v-if="item1.ima!=''"></image>
								{{item1.color}}
							</view>
						</view>

					</view>
				</view>
				<view class="popup_number">
					<view class="popup_number_left">
					购买数量
					</view>
					<view class="popup_number_right">
					<yp-number-box :min="1" :max="9" v-model="number"  @change="changee"></yp-number-box>
					</view>
				</view>
				<view class="popup_number_queding" @click="queding">
					确定
				</view>
			</view>
		</uni-popup>


	</view>
</template>

<script>
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import ypNumberBox from "@/components/yp-number-box/yp-number-box.vue"
	export default {
		components: {
			uniPopup,
			ypNumberBox
		},

		data() {
			return {
				n:0,
				number:'',
				getlunbo: [{
						cover: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
					},
					{
						cover: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
					},
					{
						cover: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
					},
					{
						cover: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
					},
					{
						cover: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
					}
				],
				list: [{
						img: "https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg",
						title: "男道春装新款人物头像印花套头卫衣男士连帽外套",
						price: "108.90",
						text: '卫衣质量特别好，价格也是很便宜',
						xiaoliang: '9528',
						pingfen: '4.8'
					},
					{
						img: "https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg",
						title: "男道春装新款人物头",
						price: "108.90",
						text: '卫衣质量特别好，价格也是很便宜',
						xiaoliang: '9528',
						pingfen: '4.8'
					},
					{
						img: "https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg",
						title: "男道春装新款人物头像印花套头卫衣男士连帽外套",
						price: "108.90",
						text: '卫衣质量特别好，价格也是很便宜',
						xiaoliang: '9528',
						pingfen: '4.8'
					},
					{
						img: "https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg",
						title: "男道春装新款人物头像印花套头卫衣男士连帽外套",
						price: "108.90",
						text: '卫衣质量特别好，价格也是很便宜',
						xiaoliang: '9528',
						pingfen: '4.8'
					}
				],
				GUIGE: [{
						title: "颜色",
						sku: [{
								color: '黑色黑色',
								ima: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
							},
							{
								color: '白色',
								ima: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
							},
							{
								color: '黑色',
								ima: 'https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=3252521864,872614242&fm=26&gp=0.jpg'
							}
						]
					},
					{
						title: "尺寸",
						sku: [{
								color: 'L',
								ima: ''
							},
							{
								color: 'M',
								ima: ''
							},
							{
								color: 'mL',
								ima: ''
							}

						],
						suanze:''
					}
				]
			}
		},
		methods: {
			changee(e){
				console.log(e)
				let self=this
				self.number=e
			},
			open(e) {
				if(e==1){
					this.suanze=1 //购物车打开
				}else{
					this.suanze=2//立即购买打开
				}
				this.$refs.popup.open()
			},
			queding(){
				if(this.suanze==1){
					uni.showToast({
					    title: '加入购物车成功',
					    duration: 1000
					});
				}else{
					//去订单页
					uni.showToast({
					    title: '去订单页//未写',
					    duration: 1000
					});
				}
			},
			close() {
				this.$refs.popup.close()
			},
			dianji(item1,index){
				this.n=index
				console.log(item1)
			},
			gopingjia(){
				uni.navigateTo({
					url:"evaluate"
				})
			},
			
		}
	}
</script>

<style lang="less">
	.swiper_box {
		width: 750rpx;
		height: 493rpx;

		image {
			width: 750rpx;
			height: 493rpx;
		}
	}

	.peoduct_top {
		height: 310rpx;
		width: 750rpx;
		padding-top: 57rpx;
		padding-left: 31rpx;
		padding-right: 31rpx;
		box-sizing: border-box;

		.peoduct_top_title {
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: rgba(46, 46, 46, 1);
		}

		.peoduct_top_price {
			display: flex;
			margin-top: 20rpx;
			box-sizing: border-box;
			justify-content: space-between;

			.peoduct_top_price_left {
				color: red;
			}

			.peoduct_top_price_right {
				color: #8E8E8E;
				font-size: 30rpx;
			}
		}

		.product_hengxina {
			width: 100%;
			height: 1rpx;
			background-color: #E5E5E5;
			margin-top: 26rpx;
		}

		.product_soack {
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.product_soack_left {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(142, 142, 142, 1);

				image {
					width: 30rpx;
					height: 30rpx;
					margin-right: 10rpx;
				}
			}

			.product_soack_right {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(142, 142, 142, 1);
			}
		}
	}

	.product_sku {
		height: 120rpx;
		width: 750rpx;
		display: flex;
		align-items: center;
		border-top: 10rpx solid #EFEFF4;
		border-bottom: 10rpx solid #EFEFF4;
		box-sizing: border-box;
		font-size: 30rpx;
		padding-left: 30rpx;
		color: rgba(142, 142, 142, 1);

		text {
			margin-left: 47rpx;
			color: #7322D8;
		}
	}

	.product_comment {
		width: 750rpx;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0px 5rpx 14rpx 2rpx rgba(115, 34, 216, 0.05);
		border-radius: 0px 0px 30rpx 30rpx;
		padding: 30rpx;
		box-sizing: border-box;

		.product_comment_top {
			height: 76rpx;
			width: 100%;
			border-bottom: 1rpx solid #E5E5E5;
			display: flex;
			justify-content: space-between;
			font-size: 30rpx;

			.product_comment_top_right {
				color: #722BCB;
			}
		}

		.product_comment_center {
			height: 100%;
			padding-left: 108rpx;
			box-sizing: border-box;

			.product_comment_center_top {
				font-size: 26rpx;
				line-height: 40rpx;
			}

			.product_comment_for_list {
				display: flex;
				justify-content: space-between;

				.product_comment_for {
					display: flex;
					justify-content: space-between;
					width: 100%;

					image {
						width: 98rpx;
						height: 98rpx;
						background: rgba(115, 34, 216, 1);
						border-radius: 10rpx;
						margin: 30rpx 0;
					}
				}

			}
		}

		.product_comment_people {
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 100rpx;

			.product_comment_people_left {
				font-size: 30rpx;
				display: flex;
				align-items: center;

				image {
					width: 60rpx;
					height: 60rpx;
					margin-right: 20rpx;
				}
			}

			.product_comment_people_right {
				font-size: 30rpx;
				color: #2E2E2E;
			}
		}
	}

	.Product_xiangqing {
		width: 750rpx;
		height: 100rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #EFEFF4;

		image {
			width: 234rpx;
			height: 28rpx;
		}
	}

	.product_pic {
		width: 750rpx;
		display: flex;
		flex-wrap: wrap;
		padding: 0 20rpx;
		box-sizing: border-box;

		image {
			width: 710rpx;
		}
	}

	.product_list {
		background-color: #EFEFF4;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		padding: 0 35rpx;
		padding-bottom: 120rpx;

		.product_list_box {
			width: 325rpx;
			height: 501rpx;
			background: rgba(255, 255, 255, 1);
			border-radius: 20rpx;
			margin-bottom: 34rpx;

			image {
				width: 325rpx;
				height: 284rpx;
				border-radius: 20rpx 20rpx 0px 0px;
			}

			.product_list_box_bottom {
				width: 100%;
				padding-left: 15rpx;
				padding-right: 15rpx;
				box-sizing: border-box;

				.product_list_bottom {
					display: flex;
					justify-content: space-between;
					font-size: 22rpx;
					margin-top: 10rpx;

					.product_list_bottom_left {
						color: #8E8E8E;
					}

					.product_list_bottom_right {
						color: red;
					}

					.product_list_bottom_ri ght {
						font-size: 28rpx;
						color: red;
					}
				}

				.product_list_title {
					font-size: 28rpx;
					color: #2E2E2E;
					height: 80rpx;
				}

				.product_list_price {
					font-size: 28rpx;
					color: red;
				}

				.product_list_txt {
					font-size: 22rpx;
					color: #8E8E8E;
				}
			}
		}
	}

	.product_fiexd {
		width: 750rpx;
		height: 100rpx;
		position: fixed;
		bottom: 0;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0px -10rpx 18rpx 2rpx rgba(115, 34, 216, 0.1);
		color: #333333;
		font-size: 28rpx;
		padding-left: 30rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;

		.product_fiexd_lisy {
			display: flex;
			flex-direction: column;
			flex-wrap: wrap;
			margin-right: 60rpx;
			align-items: center;

			image {
				width: 40rpx;
				height: 36rpx;
			}
		}

		.product_fiexd_button {
			width: 300rpx;
			height: 80rpx;
			background: rgba(115, 34, 216, 1);
			border-radius: 20rpx;
			font-size: 38rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: rgba(255, 255, 255, 1);
			text-align: center;
			line-height: 80rpx;
		}
	}

	.popup_box {
		width: 750rpx;
		height: 900rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 20rpx 20rpx 0px 0px;
		position: relative;
		padding: 30rpx;
		box-sizing: border-box;

		.popup_box_top {
			height: 145rpx;
			display: flex;
			margin-bottom: 40rpx;

			.popup_box_top_left {
				width: 145rpx;
				height: 145rpx;
				margin-right: 25rpx;

				image {
					width: 145rpx;
					height: 145rpx;
				}
			}

			.popup_box_top_center {
				width: 100%;
				padding-top: 28rpx;
				box-sizing: border-box;

				.popup_box_top_center_guige {
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
				}
			}
		}
	}

	.popup_box_guige_box {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
		margin-top: 30rpx;

		.popup_box_guige_box_list {
			height: 60rpx;
			display: flex;
			margin-top: 30rpx;
			border-bottom: 1rpx solid #FFFFFF;
			padding-bottom: 30rpx;
			.popup_box_guige_for {
				height: 60rpx;
				border: 1rpx solid #EFEFF4;
				background: rgba(239, 239, 244, 1);
				border-radius: 10rpx;
				box-sizing: border-box;
				margin-right: 20rpx;
				display: flex;
				padding: 5rpx 20rpx;
				align-items: center;
				image {
					width: 50rpx;
					height: 50rpx;
				}
			}
		}
	}
	.popup_number{
		height: 100rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1rpx solid #E5E5E5;
		box-sizing: border-box;
		.popup_number_left{
			font-size: 30rpx;
			
		}
	}
	.popup_number_queding{
		width:680rpx;
		height:90rpx;
		background:rgba(115,34,216,1);
		box-shadow:0px 0px 18rpx 2rpx rgba(115,34,216,0.3);
		border-radius:20rpx;
		text-align: center;
		color: white;
		line-height: 90rpx;
		margin-top: 80rpx;
	}
	.checked{
		color: #7322D8;
		border: 1rpx solid #7322D8 !important;
	}
</style>
